app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
↳ QTRS
↳ Overlay + Local Confluence
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
↳ QTRS
↳ Overlay + Local Confluence
↳ QTRS
↳ DependencyPairsProof
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(ascending_sort, x0)
app(descending_sort, x0)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(f, x), h)
APP(descending_sort, l) → APP(sort, max)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(sort, f), g), t)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(cons, app(app(f, x), h))
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
APP(descending_sort, l) → APP(app(sort, max), min)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(app(insert, f), g), t)
APP(app(app(app(insert, f), g), nil), x) → APP(cons, x)
APP(app(min, app(s, x)), app(s, y)) → APP(app(min, x), y)
APP(app(max, app(s, x)), app(s, y)) → APP(app(max, x), y)
APP(app(app(app(insert, f), g), nil), x) → APP(app(cons, x), nil)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(insert, f), g)
APP(app(max, app(s, x)), app(s, y)) → APP(max, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(g, x), h)
APP(app(min, app(s, x)), app(s, y)) → APP(min, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(g, x)
APP(ascending_sort, l) → APP(app(app(sort, min), max), l)
APP(ascending_sort, l) → APP(sort, min)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(app(app(insert, f), g), t), app(app(g, x), h))
APP(ascending_sort, l) → APP(app(sort, min), max)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(insert, f), g), app(app(app(sort, f), g), t))
APP(descending_sort, l) → APP(app(app(sort, max), min), l)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(insert, f)
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(ascending_sort, x0)
app(descending_sort, x0)
↳ QTRS
↳ Overlay + Local Confluence
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ EdgeDeletionProof
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(f, x), h)
APP(descending_sort, l) → APP(sort, max)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(sort, f), g), t)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(cons, app(app(f, x), h))
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
APP(descending_sort, l) → APP(app(sort, max), min)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(app(insert, f), g), t)
APP(app(app(app(insert, f), g), nil), x) → APP(cons, x)
APP(app(min, app(s, x)), app(s, y)) → APP(app(min, x), y)
APP(app(max, app(s, x)), app(s, y)) → APP(app(max, x), y)
APP(app(app(app(insert, f), g), nil), x) → APP(app(cons, x), nil)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(insert, f), g)
APP(app(max, app(s, x)), app(s, y)) → APP(max, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(g, x), h)
APP(app(min, app(s, x)), app(s, y)) → APP(min, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(g, x)
APP(ascending_sort, l) → APP(app(app(sort, min), max), l)
APP(ascending_sort, l) → APP(sort, min)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(app(app(insert, f), g), t), app(app(g, x), h))
APP(ascending_sort, l) → APP(app(sort, min), max)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(insert, f), g), app(app(app(sort, f), g), t))
APP(descending_sort, l) → APP(app(app(sort, max), min), l)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(insert, f)
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(ascending_sort, x0)
app(descending_sort, x0)
↳ QTRS
↳ Overlay + Local Confluence
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ EdgeDeletionProof
↳ QDP
↳ DependencyGraphProof
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(f, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(f, x), h)
APP(descending_sort, l) → APP(sort, max)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(sort, f), g), t)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(cons, app(app(f, x), h))
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
APP(descending_sort, l) → APP(app(sort, max), min)
APP(app(app(app(insert, f), g), nil), x) → APP(cons, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(app(insert, f), g), t)
APP(app(min, app(s, x)), app(s, y)) → APP(app(min, x), y)
APP(app(max, app(s, x)), app(s, y)) → APP(app(max, x), y)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(insert, f), g)
APP(app(app(app(insert, f), g), nil), x) → APP(app(cons, x), nil)
APP(app(max, app(s, x)), app(s, y)) → APP(max, x)
APP(ascending_sort, l) → APP(app(app(sort, min), max), l)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(g, x)
APP(app(min, app(s, x)), app(s, y)) → APP(min, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(g, x), h)
APP(ascending_sort, l) → APP(sort, min)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(app(app(insert, f), g), t), app(app(g, x), h))
APP(ascending_sort, l) → APP(app(sort, min), max)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(insert, f), g), app(app(app(sort, f), g), t))
APP(descending_sort, l) → APP(app(app(sort, max), min), l)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(insert, f)
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(ascending_sort, x0)
app(descending_sort, x0)
↳ QTRS
↳ Overlay + Local Confluence
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ EdgeDeletionProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ QDP
APP(app(min, app(s, x)), app(s, y)) → APP(app(min, x), y)
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(ascending_sort, x0)
app(descending_sort, x0)
MIN(s(x), s(y)) → MIN(x, y)
max(0, x0)
max(x0, 0)
max(s(x0), s(x1))
min(0, x0)
min(x0, 0)
min(s(x0), s(x1))
insert(x0, x1, nil, x2)
insert(x0, x1, cons(x2, x3), x4)
sort(x0, x1, nil)
sort(x0, x1, cons(x2, x3))
ascending_sort(x0)
descending_sort(x0)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
APP(app(min, app(s, x)), app(s, y)) → APP(app(min, x), y)
trivial
↳ QTRS
↳ Overlay + Local Confluence
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ EdgeDeletionProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ PisEmptyProof
↳ QDP
↳ QDP
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(ascending_sort, x0)
app(descending_sort, x0)
↳ QTRS
↳ Overlay + Local Confluence
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ EdgeDeletionProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
APP(app(max, app(s, x)), app(s, y)) → APP(app(max, x), y)
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(ascending_sort, x0)
app(descending_sort, x0)
MAX(s(x), s(y)) → MAX(x, y)
max(0, x0)
max(x0, 0)
max(s(x0), s(x1))
min(0, x0)
min(x0, 0)
min(s(x0), s(x1))
insert(x0, x1, nil, x2)
insert(x0, x1, cons(x2, x3), x4)
sort(x0, x1, nil)
sort(x0, x1, cons(x2, x3))
ascending_sort(x0)
descending_sort(x0)
The following pairs can be oriented strictly and are deleted.
The remaining pairs can at least be oriented weakly.
APP(app(max, app(s, x)), app(s, y)) → APP(app(max, x), y)
trivial
↳ QTRS
↳ Overlay + Local Confluence
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ EdgeDeletionProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDPOrderProof
↳ QDP
↳ PisEmptyProof
↳ QDP
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(ascending_sort, x0)
app(descending_sort, x0)
↳ QTRS
↳ Overlay + Local Confluence
↳ QTRS
↳ DependencyPairsProof
↳ QDP
↳ EdgeDeletionProof
↳ QDP
↳ DependencyGraphProof
↳ AND
↳ QDP
↳ QDP
↳ QDP
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(app(app(insert, f), g), t), app(app(g, x), h))
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(f, x)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(sort, f), g), t)
APP(app(app(sort, f), g), app(app(cons, h), t)) → APP(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
APP(ascending_sort, l) → APP(app(app(sort, min), max), l)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(g, x)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(g, x), h)
APP(descending_sort, l) → APP(app(app(sort, max), min), l)
APP(app(app(app(insert, f), g), app(app(cons, h), t)), x) → APP(app(f, x), h)
app(app(max, 0), x) → x
app(app(max, x), 0) → x
app(app(max, app(s, x)), app(s, y)) → app(app(max, x), y)
app(app(min, 0), x) → 0
app(app(min, x), 0) → 0
app(app(min, app(s, x)), app(s, y)) → app(app(min, x), y)
app(app(app(app(insert, f), g), nil), x) → app(app(cons, x), nil)
app(app(app(app(insert, f), g), app(app(cons, h), t)), x) → app(app(cons, app(app(f, x), h)), app(app(app(app(insert, f), g), t), app(app(g, x), h)))
app(app(app(sort, f), g), nil) → nil
app(app(app(sort, f), g), app(app(cons, h), t)) → app(app(app(app(insert, f), g), app(app(app(sort, f), g), t)), h)
app(ascending_sort, l) → app(app(app(sort, min), max), l)
app(descending_sort, l) → app(app(app(sort, max), min), l)
app(app(max, 0), x0)
app(app(max, x0), 0)
app(app(max, app(s, x0)), app(s, x1))
app(app(min, 0), x0)
app(app(min, x0), 0)
app(app(min, app(s, x0)), app(s, x1))
app(app(app(app(insert, x0), x1), nil), x2)
app(app(app(app(insert, x0), x1), app(app(cons, x2), x3)), x4)
app(app(app(sort, x0), x1), nil)
app(app(app(sort, x0), x1), app(app(cons, x2), x3))
app(ascending_sort, x0)
app(descending_sort, x0)